﻿


namespace LaserMark.Extensions;

public static class GetRotatePointExtension
{
    public static (double, double) RotatePointAroundCenter(double x, double y, double centerX, double centerY, double rad)
    {
        double cosTheta = Math.Cos(rad);
        double sinTheta = Math.Sin(rad);

        double dx = x - centerX;
        double dy = y - centerY;
        return (dx * cosTheta - dy * sinTheta + centerX, dx * sinTheta + dy * cosTheta + centerY);
    }
}
